package com.accp.demo.controller.finance;

import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.accp.demo.service.finance.AdvanceService;

@Controller
@RequestMapping("/advance/")
public class AdvanceController {
	@Autowired
	private AdvanceService advanceService;
	
	/**
	 * 分页查询
	 * @param page
	 * @return
	 */
	@ResponseBody
	@RequestMapping("findByPage")
	public Object findByPage(int page){
		return this.advanceService.findByPage(page, 1);
	}
	
	/**
	 * 主详新增
	 * @param advance
	 */
	@ResponseBody
	@RequestMapping("addAdvance")
	public void addAdvance(@RequestBody Map<String, Object> map){
//		System.out.println(advance);
		this.advanceService.addAdvance(map);
	}
	
	/**
	 * 修改主表
	 * @param advance
	 */
	@ResponseBody
	@RequestMapping("updateAdvance")
	public void updateAdvance(@RequestBody Map<String,Object> map){
		this.advanceService.updateAdvance(map);
	}
	
	/**
	 * 删除主表
	 * @param advance
	 */
	@ResponseBody
	@RequestMapping("deleteAdvance")
	public void deleteAdvance(@RequestBody Map<String,Object> map){
		this.advanceService.deleteAdvance(map);
	}
	   
	/**
	 * 审核/反审核
	 * @param map
	 */
	@ResponseBody
	@RequestMapping("updatePermitter")
	public void updatePermitter(@RequestBody Map<String,Object> map){
		this.advanceService.updatePermitter(map);
	}
}
